From: Benjamin Berg Date: Mon, 13 Feb 2017 13:52:23 +0000 (+0100) Subject: network: Ensure the connection list is sorted after rename X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~1013^2^2~548 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=30e17036e8bec8dd47f68eb6b1d3cfe3ca037caf;p=gnome-shell.git network: Ensure the connection list is sorted after rename Items were inserted correctly but the synchronisation was lost if the name of a connection was changed. Simply making sure the position is correct after a connection is updated fixes the issue. Reported-by: Oliver Haessler https://bugzilla.gnome.org/show_bug.cgi?id=778686 --- diff --git a/js/ui/status/network.js b/js/ui/status/network.js index 835c315f6..72f973a6a 100644 --- a/js/ui/status/network.js +++ b/js/ui/status/network.js @@ -299,11 +299,22 @@ const NMConnectionSection = new Lang.Class({ let item = this._connectionItems.get(connection.get_uuid()); if (item) - item.updateForConnection(connection); + this._updateForConnection(item, connection); else this._addConnection(connection); }, + _updateForConnection: function(item, connection) { + let pos = this._connections.indexOf(connection); + + this._connections.splice(pos, 1); + pos = Util.insertSorted(this._connections, connection, Lang.bind(this, this._connectionSortFunction)); + this._labelSection.moveMenuItem(item.labelItem, pos); + this._radioSection.moveMenuItem(item.radioItem, pos); + + item.updateForConnection(connection); + }, + _addConnection: function(connection) { let item = this._makeConnectionItem(connection); if (!item)